package com.szqhyxj.youxiangju.biz.card;

import java.util.ArrayList;
import java.util.List;

import io.reactivex.disposables.Disposable;

/**
 * XiaoPanYu
 * on 2018/10/31
 */
public class CardPresenter implements CardContarct.Presenter{

    private final CardContarct.View view;

    public CardPresenter(CardContarct.View  view){
        this.view = view;
    }

    private List<Disposable> disposables = new ArrayList<>();

    @Override
    public void onDestroy(){
        for (Disposable disposable : disposables) {
            if (disposable != null) {
                disposable.dispose();
            }
        }
    }

    public void init(){}

    @Override
    public void credit(){
        view.showCredit();
    }

    @Override
    public void deposit(){
        view.showDeposit();
    }

    @Override
    public void addCard(){
        view.navAddCard();
    }
}
